/*
target (_this select 0): Object - the object which the action is assigned to
caller (_this select 1): Object - the unit that activated the action
ID (_this select 2): Number - ID of the activated action (same as ID returned by addAction) 
arguments (_this select 3): Anything - arguments given to the script if you are using the extended syntax 
*/

_crate = _this select 0;  //  addaction is passing you the target of the action
_addId = _this select 2; //  addaction is passing you its own ID.

player playAction "grabDrag";
Sleep (0.01);
//waitUntil { ((AnimationState player) == "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2 ") || ((AnimationState player) == "AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_2 ")};
_crate attachTo [player, [0,1.0,0.3]];
player playMove "AcinPknlMwlkSrasWrflDb";

obj1attached=true;
PublicVariable "obj1attached";

Drop1 = player addAction ["<t color=""#930909"">" +"Drop</t>","PHM\Objects\Detach_big.sqf",[_crate],1,true,true,"","obj1attached"];

while {obj1attached} do {
	[] spawn {
	{Player removeaction _addId} forEach allUnits;
	};
};